import * as bm from "/js/baseModule.js";

export class Module extends bm.baseModule {
    constructor(view) {
        super(view);
        let that = this;
        that.prov = {
            subs: []
        };
        new Vue({
            el: "#selcity_vue",
            data: { prov: that.prov },
            methods: {
                clickCity: function (city) {
                    globalData.selPos.city = city.name;
                    globalData.selPos.city_id = city.adcode;
                    globalData.selPos.prov = that.prov.name;
                    globalData.selPos.prov_id = that.prov.adcode;
                    funs.getModuleFuns('modules/project/ProjectList.js',function (mod) {
                        mod.setCity(city.name);
                    });
                    location.hash = 'index';
                }
            }
        });
    }
    initTpl(prov) {
        let that = this;
        that.prov.adcode = prov.adcode;
        that.prov.name = prov.name;
        that.prov.provCity = prov.provCity;
        that.prov.containType = prov.containType;
        that.prov.containInfo = prov.containInfo;
        that.prov.subs.length = 0;
        that.prov.subs.push(...prov.subs);
    }

    _evt_chooseAllProv() {
        let that = this;
        globalData.selPos.city = that.prov.name;
        globalData.selPos.city_id =  that.prov.name;
        globalData.selPos.prov = that.prov.name;
        globalData.selPos.prov_id = that.prov.name;
        funs.getModuleFuns('modules/project/ProjectList.js',function (mod) {
            mod.setCity(that.prov.name);
        });
        location.hash = 'index';
    }

}
